package com.aaa.tmr.util;

import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.shiro.crypto.hash.Sha512Hash;

import java.util.UUID;

/**
 * @author ：Marko
 * @date ：Created in 2021/3/19 9:59
 * @description ：业务常量类
 * @modified By：
 * @version:
 */
public class BussinessConstants {

    public interface UserCheck{
        String ALGORITHM_NAME="SHA-512";
        int HASH_INTERATOR=1024;
    }

    /**
     * 操作日志业务类型
     */
    public interface  OperBussinessType{
        Integer  ADD=1;
        Integer  UPDATE=2;
        Integer  DELETE=3;
    }


    public static void main(String[] args) {
       /* String salt = UUID.randomUUID().toString();
        System.out.println(salt);
        Sha512Hash sha512Hash =new Sha512Hash("admin",salt,1024);
        System.out.println(sha512Hash.toString());*/

       String salt="a10ea41d-104a-43a7-8dce-1067e909c9b0";
       Md5Hash md5Hash  =new Md5Hash("admin",salt,1000);
       System.out.println(md5Hash.toString());
    }
    public static String[] getSha512(String password){
        String salt = UUID.randomUUID().toString();
        Sha512Hash sha512Hash =new Sha512Hash(password,salt,1024);
        String[] passwordAndSalt ={sha512Hash.toString(),salt};
       return passwordAndSalt;

    }
}
